package com.yfqy.app.modules.product.resource;

import com.yfqy.app.domain.vo.ResultVO;
import com.yfqy.app.modules.product.service.CategoryService;
import com.yfqy.app.modules.product.vo.CategoryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商品分类管理
 */
@RestController
@RequestMapping("/api/client/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;


    /**
     * 商品分类分页列表
     *
     * @return
     */
    @GetMapping("/all")
    public ResultVO<List<CategoryVO>> all() {
        return ResultVO.data(categoryService.all());
    }


}
